package com.mistoplus.sedona;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class BookNow extends Activity {

	private ImageView mImvBook;
	private ImageView mImveBook;
	private ImageView mImvLeftBack;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	
	    setContentView(R.layout.book_now);
	    
	    mImvBook = (ImageView)findViewById(R.id.imv_book);
	    mImveBook = (ImageView)findViewById(R.id.imv_e_book);
	    mImvLeftBack = (ImageView)findViewById(R.id.imv_left_back);
	    
	    mImvBook.setOnClickListener(onClick);
	    mImveBook.setOnClickListener(onClick);
	    mImvLeftBack.setOnClickListener(onClick);
	}
	
	private OnClickListener onClick = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.imv_book:
				callBookSite();
				break;
			case R.id.imv_e_book:
				callEBookSite();
				break;
			case R.id.imv_left_back:
				finish();
				break;
			}
		}
	};
	
	private void callBookSite(){
		Uri uri = Uri.parse("http://www.callofsedona.com/app-get-book"); 
		Intent intent  = new Intent(Intent.ACTION_VIEW,uri); 
		startActivity(intent);
	}
	
	private void callEBookSite(){
		Uri uri = Uri.parse("http://www.callofsedona.com/app-get-e-book"); 
		Intent intent  = new Intent(Intent.ACTION_VIEW,uri); 
		startActivity(intent);
	}

}
